#include <iostream>
#include "mtfM.h"
#include "Alfabeto.h"

using namespace std;

int mtf_algoritmoM(unsigned char * L,unsigned char * R,unsigned int N, Alfabeto& alf){
    
    //cout << "mtfM - A transformar " << L << endl;
    
    int i = 0;
    int pos = 0;
    unsigned char ch;
    
    for (i=0;i<N;i++){
        ch = L[i];
        pos = alf.buscar(&ch);
        R[i] =(unsigned char) pos;
        alf.mover_al_frente(R[i]);
    }
    
    return 0;
}
